import { createRouter, createWebHistory } from 'vue-router';
// 使用 import type 导入类型
import type { RouteRecordRaw } from 'vue-router';

// 导入页面
import Home from '@/Layout';
import About from '@/views/About.vue';
import Login from '@/views/Login';
import UserInfo from '@/views/User/Info'
import Audit from "@/views/Audit";
import Workbench from "@/views/Workbench";
import Test from "@/views/test.vue";

const routes: RouteRecordRaw[]  = [
    {
        path: '/',
        name: 'home',
        component: Home,
        children: [
            {
                path: "/workbench",
                name: "workbench",
                component: Workbench
            },
            {
                path: "/user/info",
                name: "userInfo",
                component: UserInfo
            },
            {
                path: "/aduit",
                name: "aduit",
                component: Audit
            }
        ]
    },
    {
        path: '/about',
        name: 'About',
        component: About
    },
    {
        path: '/rbac/login',
        name: 'login',
        component: Login
    },
    {
        path: '/test',
        name: 'test',
        component: Test
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;